package com.echo.code.spring.web;

import lombok.extern.java.Log;
import lombok.extern.log4j.Log4j;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * Description
 *
 * @author baiyp
 * @version 1.0.0
 * @date 2019/04/23
 */
@RestControllerAdvice
@Log4j
public class ExceptionHandlerController {

  @ExceptionHandler(value = Exception.class)
  public String handleException(Exception ex) {
    log.error(ex.getMessage());
    return "error";
  }
}
